import 'package:flutter/material.dart';
import 'package:super_tool_server/component/navigator/navigator.dart';
import 'package:super_tool_server/component/theme/theme.dart';
import 'package:super_tool_server/page/home/super_tool_widget.dart';

class PageManager {
  static final customRouteDelegate = CustomRouteDelegate();
  static const String page_home = '/';

  static Widget getPage(String? pageName, {Map<String, dynamic> arguments = const {}}) {
    Widget result = SuperToolWidget(arguments);
    if (pageName != null) {
      switch (pageName) {
        case page_home:
          result = SuperToolWidget(arguments);
          break;
      }
    }
    return Scaffold(
      // backgroundColor: black_141414,
      body: CustomTheme(
        themeData: TEThemeData(),
        child: WillPopScope(onWillPop: _canNavigatorPop, child: result),
      ),
    );
  }

  static Future<bool> _canNavigatorPop() async {
    return true;
  }
}
